import 'package:get/get.dart';
import 'package:jinke/page/pro_list/subs/pro_detail/subs/pro_instruction/model/ProInstruction.dart';

import '../../../../../../utils/httputils/api.dart';
import '../../../../../../utils/httputils/resultdata.dart';
import 'state.dart';

class ProInstructionController extends GetxController {
  ProInstructionController();
  final state = ProInstructionState();
  initData() async{

    ResultData response = await Api.listPageDirectives({'projectId': state.proId});
    state.lists.clear();
    List list = response.data;
    state.lists.addAll(list.map((e) => ProInstruction.fromJson(e)).toList());

    update();
  }

  void onTap() {}

  // @override
  // void onInit() {
  //   super.onInit();
  // }

  @override
  void onReady() {
    super.onReady();
    // initData();
  }

  // @override
  // void onClose() {
  //   super.onClose();
  // }
}
